<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('room')} > ${i18n.getMessage('edit')}">
	<a href="#" onclick="cc('materialFacilities/showInfoRoom.sgt?id=${(room.id)!}')">${i18n.getMessage('room')}</a>
</@showTitle>

<div id="error" style="display:none"></div>

<form action="materialFacilities/editRoom.sgt" validator="materialFacilities/validateRoom.sgt" onsubmit="submitFormValidation(this); return false;" onreset="$('error').hide()">
	<input type="hidden" name="id" value="${(room.id)!}"/>
	<input type="hidden" name="version" value="${(room.version)!}"/>

	<table id="dataTable" align="center" cellspacing="5" cellpadding="0">
		<tr>
			<td class="name">${i18n.getMessage('location')}:</td>
			<td>
				<select name="locationId" style="width:205px">
					<option></option>
					<#list locations as location>
						<option value="${location.id}" <#if ((room.location)! = location)>selected</#if>>${location.name}</option>
					</#list>
				</select>
			</td>
		</tr>
		<tr>
			<td class="name"><@required/>${i18n.getMessage('code')}:</td>
			<td><input type="text" name="code" value="${(room.code)!}" style="width:200px"/> </td>
		</tr>
		<tr>
			<td class="name"><@required/>${i18n.getMessage('name')}:</td>
			<td><input type="text" name="name" value="${(room.name)!}" style="width:200px"/> </td>
		</tr>
		<tr>
			<td class="name"><@required/>${i18n.getMessage('seatCount')}:</td>
			<td><input type="text" name="seatCount" value="${(room.seatCount)!}" style="width:200px"/></td>
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('options')}:</td>
			<td><input type="checkbox" name="active" value="true" <#if room.active>checked</#if>/> ${i18n.getMessage('active')}</td>
		</tr>
		<tr>
			<td class="name" style="vertical-align:top">${i18n.getMessage('comment')}:</td>
			<td><textarea name="comment" style="width:350px;height:80px;">${(room.comment)!}</textarea></td>
		</tr>
		<tr>
			<td class="name"></td>
			<td>
				<input type="submit" value="${i18n.getMessage('edit')}" class="button_style"/> 
				<input type="reset" value="${i18n.getMessage('reset')}" class="button_style"/> 
			</td>
		</tr>
	</table>
</form>

<script>
	$('error').hide();
</script>